﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CQRSFramework.Domains
{
    public interface IAggregateFactory
    {
        /// <summary>
        /// 通过反射实例化对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T CreateAggregate<T>() where T : IAggregateRoot;
        /// <summary>
        /// 不调用构造函数实例化对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="type"></param>
        /// <returns></returns>
        T CreateAggregate<T>(Type type) where T : IAggregateRoot;
    }
}
